<%-- 
    Document   : Activation
    Created on : May 17, 2014, 5:28:11 AM
    Author     : Yogesh
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>


        <iframe name="CHATBUTTON_CHATBOX" id="CHATBUTTON_CHATBOX" src="https://www.chatbutton.com/chatroom/18348847/" width="290" height="400" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" allowtransparency="true" scrolling="no"><a href="https://www.chatbutton.com/chatroom/18348847/">Enter Chat Room</a></iframe>
<script type="text/javascript">
CHBT_channel="18348847";
CHBT_profanityfilter="1";
CHBT_position="bottom-right";
</script>
<script type="text/javascript" src="https://www.chatbutton.com/c.js">
</script>

        <h1>profile get activated</h1>

        <%
                org.hibernate.SessionFactory sessionFactory=com.Auto.Common.Userinformtion.Hibernate.Userinformation_HibernateUtil.getSessionFactory();
                          org.hibernate.Session Opensession=sessionFactory.openSession();
                            org.hibernate.Transaction transaction=Opensession.beginTransaction();

                 String code=(String)session.getAttribute("code");

                 if(request.getParameter("code")==null){
                     }
                 else{

                     code=(String)request.getParameter("code");

                     }




                  org.hibernate.Query query=Opensession.createQuery("from com.Auto.Common.Userinformtion.Hibernate.Userinformation where activationCode='"+code+"'");

                    java.util.List l=query.list();

                    String pic="";


                    //uinfo.setProfileState("1");

                         for (Object o : l) {

                         
                            com.Auto.Common.Userinformtion.Hibernate.Userinformation uinfo=(com.Auto.Common.Userinformtion.Hibernate.Userinformation)o;

                         uinfo.setProfileState("1");



                                    }
                        transaction.commit();



                   for(Object o:l){

                      com.Auto.Common.Userinformtion.Hibernate.Userinformation uifor=(com.Auto.Common.Userinformtion.Hibernate.Userinformation)o;

                      // out.print(uinfo.getProfileState());




                       String id1=uifor.getId()+"";

                                        session.setAttribute("firstName", uifor.getFirstName());
                                        session.setAttribute("lastName",uifor.getLastName());
                                        session.setAttribute("id", id1);
                                        session.setAttribute("middelName", uifor.getMiddelName());
                                        session.setAttribute("address",uifor.getAddress());
                                        session.setAttribute("mobileNumber",uifor.getMobileNumber());
                                        session.setAttribute("emailId",uifor.getEmailId());
                                        session.setAttribute("gender",uifor.getGender());
                                        session.setAttribute("dob",uifor.getDob());
                                        session.setAttribute("password",uifor.getPassword());
                                        session.setAttribute("city",uifor.getCity());
                                        session.setAttribute("CountryState",uifor.getCountryState());
                                        session.setAttribute("pinCode",uifor.getPinCode());
                                        session.setAttribute("contry",uifor.getContry());
                                        session.setAttribute("profPic",uifor.getProfPic());
                                        session.setAttribute("activationCode",uifor.getActivationCode());
                                        session.setAttribute("profileState",uifor.getProfileState());
                                        session.setAttribute("profileStatus",uifor.getProfileStatus());
                                        session.setAttribute("profileCompletion",uifor.getProfileCompletion());

                                             pic=uifor.getProfPic();

                       }


                   response.sendRedirect("FixLogin.jsp");


        %>
    </body>
</html>
